home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: DoIdle
- Sent: 6/13/96 11:28 PM
- Received: 6/14/96 9:17 AM
- From: Arni McKinley, motion@nbn.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >If anyone has an example of idling a non-target frame (from the frame's
- >class), I would still be interested in seeing how it is done.
-
-
- I have a LabelShape (a CBaseShape in ODFDraw or Sketch code) that requires
- an idler in order to blink the caret in the label. When it gets to be time
- to edit the label I make an FW_CEditView then do this:
- in EditLabel()
- fEditView->Enable(ev);
- fEditView->BecomeTarget( ev );
-
- if( fIdler == NULL )
- {
- fIdler = FW_NEW(FW_CIdler, (fEditView->GetFrame(ev), 5));
- fIdler->RegisterIdle(ev);
- }
-
- Later when the Label is deselected by the user I do this
- in SelectLabel( FW_Boolean state )
- if( !state)
- {
- fEditView->Disable(ev);
- if( fIdler )
- {
- fIdler->UnregisterIdle( ev );
-
- delete fIdler;
- fIdler = NULL;
- }
- }
-
- Sometime or other, you need to delete the idler. I do it when the Edit View
- is deleted
- if( fIdler )
- {
- fIdler->UnregisterIdle( ev );
-
- delete fIdler;
- fIdler = NULL;
- }
-
- Hope this helps
-
- Arni
-
-
-